import java.util.*;

public class TestDay37 {


    //数据库连接池
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = scanner.nextInt();
            HashSet<String> hashSet = new HashSet<>();
            int max = 0;
            for (int i = 0; i < n; i++) {
                String a = scanner.next();
                String b = scanner.next();
                String str = "connect";
                if(b.equals(str)){
                    //如果是创建链接
                        //看是否包含a
                        //如果不包含就添加
                        //记录此时的size
                        hashSet.add(a);
                        if(max < hashSet.size()){
                            max = hashSet.size();;
                        }
                }else {
                    //此时是删除
                    hashSet.remove(a);
                }
            }
            System.out.println(max);
        }
    }

    //mkdir
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            //记录输入次数
            int n = scanner.nextInt();
            scanner.nextLine();
            String[] array = new String[n];
            for (int i = 0; i < n ; i++) {
                array[i] = scanner.next();
            }
            //按照字典序进行升序排序
            Arrays.sort(array);
            //判断是否有效
            //1.重复的无效
            //2.子字符串无效
            boolean[] flog = new boolean[n];
            for (int i = 0; i < n; i++) {
                if(i+1 != array.length && array[i].equals(array[i+1])){
                    //
                    flog[i] = true;
                }else if(i+1 != array.length && array[i].length() < array[i+1].length() && array[i+1].contains(array[i]) && array[i+1].charAt(array[i].length()) == '/'){
                    //长度小于后面的,并且后面包含该字符串,并且后面在包含该字符串后又衔接了/
                    flog[i] = true;
                }
            }
            for (int i = 0; i < n; i++) {
                if(!flog[i]){
                    System.out.println("mkdir -p "+array[i]);
                }
            }
            System.out.println();

        }
    }
}
